///技师
class TechnicianBean {
  int? id;
  String? name;
  String? sex;
  String? score;
  int? servedNum;
  String? distance;
  List<String>? labels;
  String? header;
  List<String>? album;
  String? info;
  Shop? shop;
  List<String>? commentLabels;
  List<ProjectBean>? serviceItems;

  TechnicianBean(
      {this.id,
      this.name,
      this.sex,
      this.score,
      this.servedNum,
      this.distance,
      this.labels,
      this.header,
      this.album,
      this.info,
      this.shop,
      this.commentLabels,
      this.serviceItems});

  TechnicianBean.fromJson(Map<String, dynamic> json) {
    if (json["id"] is num) {
      id = (json["id"] as num).toInt();
    }
    if (json["name"] is String) {
      name = json["name"];
    }
    if (json["sex"] is String) {
      sex = json["sex"];
    }
    if (json["score"] is String) {
      score = json["score"];
    }
    if (json["servedNum"] is num) {
      servedNum = (json["servedNum"] as num).toInt();
    }
    if (json["distance"] is String) {
      distance = json["distance"];
    }
    if (json["labels"] is List) {
      labels = json["labels"] == null ? null : List<String>.from(json["labels"]);
    }
    if (json["header"] is String) {
      header = json["header"];
    }
    if (json["album"] is List) {
      album = json["album"] == null ? null : List<String>.from(json["album"]);
    }
    if (json["info"] is String) {
      info = json["info"];
    }
    if (json["shop"] is Map) {
      shop = json["shop"] == null ? null : Shop.fromJson(json["shop"]);
    }
    if (json["commentLabels"] is List) {
      commentLabels = json["commentLabels"] == null ? null : List<String>.from(json["commentLabels"]);
    }
    if (json["serviceItems"] is List) {
      serviceItems = json["serviceItems"] == null
          ? null
          : (json["serviceItems"] as List).map((e) => ProjectBean.fromJson(e)).toList();
    }
  }
  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["id"] = id;
    _data["name"] = name;
    _data["sex"] = sex;
    _data["score"] = score;
    _data["servedNum"] = servedNum;
    _data["distance"] = distance;
    if (labels != null) {
      _data["labels"] = labels;
    }
    _data["header"] = header;
    if (album != null) {
      _data["album"] = album;
    }
    _data["info"] = info;
    if (shop != null) {
      _data["shop"] = shop?.toJson();
    }
    if (commentLabels != null) {
      _data["commentLabels"] = commentLabels;
    }
    if (serviceItems != null) {
      _data["serviceItems"] = serviceItems?.map((e) => e.toJson()).toList();
    }
    return _data;
  }
}

///店铺
class Shop {
  int? shopId;
  String? shopName;
  String? shopScore;
  int? servedNum;
  List<ProjectBean>? shopServiceItems;
  List<TechnicianBean>? shopTechnicians;

  Shop.fromJson(Map<String, dynamic> json) {
    if (json["shopId"] is num) {
      shopId = (json["shopId"] as num).toInt();
    }
    if (json["shopName"] is String) {
      shopName = json["shopName"];
    }
    if (json["shopScore"] is String) {
      shopScore = json["shopScore"];
    }
    if (json["servedNum"] is num) {
      servedNum = (json["servedNum"] as num).toInt();
    }
    if (json["shopServiceItems"] is List) {
      shopServiceItems = json["shopServiceItems"] == null
          ? null
          : (json["shopServiceItems"] as List).map((e) => ProjectBean.fromJson(e)).toList();
    }

    if (json["shopTechnicians"] is List) {
      shopTechnicians = json["shopTechnicians"] == null
          ? null
          : (json["shopTechnicians"] as List).map((e) => TechnicianBean.fromJson(e)).toList();
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["shopId"] = shopId;
    _data["shopName"] = shopName;
    _data["shopScore"] = shopScore;
    _data["servedNum"] = servedNum;
    if (shopServiceItems != null) {
      _data["shopServiceItems"] = shopServiceItems?.map((e) => e.toJson()).toList();
    }
    if (shopTechnicians != null) {
      _data["shopTechnicians"] = shopTechnicians?.map((e) => e.toJson()).toList();
    }
    return _data;
  }
}

///项目
class ProjectBean {
  int? itemId;
  String? itemName;
  String? itemTime;
  String? itemOldPrice;
  String? itemPrice;
  String? itemImage;
  String? itemLabel;
  String? chooseNum;
  int? nearTechnicianNum;
  List<String>? itemPics;
  List<TechnicianBean>? itemTechnicians;
  List<TechnicianAlbumBean>? technicianAlbum;

  ProjectBean(
      {this.itemId,
      this.itemName,
      this.itemTime,
      this.itemOldPrice,
      this.itemPrice,
      this.itemImage,
      this.itemLabel,
      this.chooseNum,
      this.nearTechnicianNum,
      this.itemPics,
      this.itemTechnicians,
      this.technicianAlbum});

  ProjectBean.fromJson(Map<String, dynamic> json) {
    if (json["itemId"] is num) {
      itemId = (json["itemId"] as num).toInt();
    }
    if (json["itemName"] is String) {
      itemName = json["itemName"];
    }
    if (json["itemTime"] is String) {
      itemTime = json["itemTime"];
    }
    if (json["itemOldPrice"] is String) {
      itemOldPrice = json["itemOldPrice"];
    }
    if (json["itemPrice"] is String) {
      itemPrice = json["itemPrice"];
    }
    if (json["itemImage"] is String) {
      itemImage = json["itemImage"];
    }
    if (json["itemLabel"] is String) {
      itemLabel = json["itemLabel"];
    }
    if (json["chooseNum"] is String) {
      chooseNum = json["chooseNum"];
    }
    if (json["nearTechnicianNum"] is num) {
      nearTechnicianNum = (json["nearTechnicianNum"] as num).toInt();
    }
    if (json["itemPics"] is List) {
      itemPics = json["itemPics"] == null ? null : List<String>.from(json["itemPics"]);
    }
    if (json["itemTechnicians"] is List) {
      itemTechnicians = json["itemTechnicians"] == null
          ? null
          : (json["itemTechnicians"] as List).map((e) => TechnicianBean.fromJson(e)).toList();
    }
    if (json["technicianAlbum"] is List) {
      technicianAlbum = json["technicianAlbum"] == null
          ? null
          : (json["technicianAlbum"] as List).map((e) => TechnicianAlbumBean.fromJson(e)).toList();
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["itemId"] = itemId;
    _data["itemName"] = itemName;
    _data["itemTime"] = itemTime;
    _data["itemOldPrice"] = itemOldPrice;
    _data["itemPrice"] = itemPrice;
    _data["itemImage"] = itemImage;
    _data["itemLabel"] = itemLabel;
    _data["chooseNum"] = chooseNum;
    _data["nearTechnicianNum"] = nearTechnicianNum;
    if (itemPics != null) {
      _data["itemPics"] = itemPics;
    }
    if (itemTechnicians != null) {
      _data["itemTechnicians"] = itemTechnicians?.map((e) => e.toJson()).toList();
    }
    if (technicianAlbum != null) {
      _data["technicianAlbum"] = technicianAlbum?.map((e) => e.toJson()).toList();
    }
    return _data;
  }
}

class TechnicianAlbumBean {
  String? uname;
  String? image;

  TechnicianAlbumBean({this.image, this.uname});

  TechnicianAlbumBean.fromJson(Map<String, dynamic> json) {
    if (json["image"] is String) {
      image = json["image"];
    }
    if (json["uname"] is String) {
      uname = json["uname"];
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> _data = <String, dynamic>{};
    _data["image"] = image;
    _data["uname"] = uname;
    return _data;
  }
}

///banner
class HomeBannerBean {
  int? id;
  String? image;
  String? linkUrl;

  HomeBannerBean({this.id, this.image, this.linkUrl});

  HomeBannerBean.fromJson(Map<String, dynamic> json) {
    if (json["id"] is num) {
      id = (json["id"] as num).toInt();
    }
    if (json["image"] is String) {
      image = json["image"];
    }
    if (json["linkUrl"] is String) {
      linkUrl = json["linkUrl"];
    }
  }
}
